package cn.tedu.eliminate;

/**
 * 元素
 * 父类
 */
public abstract class Element {
    private int x;
    private int y;
    private boolean selected;//是否选中
    private boolean eliminated;//是否消除
    private int eliminatedIndex;//爆炸动画图片起始坐标
    private Element e;

    /**
     * 构造方法
     * @param x
     * @param y
     */
    public Element(int x, int y) {
        this.x = x;
        this.y = y;
        selected = false;
        eliminated = false;
        eliminatedIndex = 0;
    }

    /**
     * 设置x坐标
     * @param x
     */
    public void setX(int x) {
        this.x = x;
    }

    /**
     * 设置Y坐标
     * @param y
     */
    public void setY(int y) {
        this.y = y;
    }

    /**
     * 获取Y坐标
     * @return
     */
    public int getY() {
        return y;
    }

    /**
     * 是否为选中状态
     * @return
     */
    public boolean isSelected(){
        return selected;
    }

    /**
     * 是否可消除
     * @return
     */
    public boolean isEliminated(){
        return eliminated;
    }
    /**
     * 元素选中状态
     * @param selected
     */
    public void setSelected(boolean selected){
        this.selected = selected;
    }

    /**
     * 设置元素可消状态
     * @param eliminated
     */
    public void setEliminated(boolean eliminated) {
        this.eliminated = eliminated;
    }


}
